<?php 
if($mode== "ADD"){

	?>
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading">
			CATEGORY MANAGEMENT (ADD) <span class="pull-right"><a
				href="<?= base_url();?>secure/category_tree/management/show"
				type="button" class="btn btn-success btn-sm">Back to List</a> </span>
		</header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="add_category"
				method="post"
				action="<?= base_url();?>secure/category_tree/management/insert">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Title</label>
					<div class="col-lg-8">
						<span class="text text-danger">
						<?php echo form_error('title');?></span>
						<input type="text" class="form-control" id="title" name="title"
							placeholder="Website Title" value="<?php echo set_value('title');?>">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Url</label>
					<div class="col-lg-8">
					<span class="text text-danger">
						<?php echo form_error('url');?></span>
						<input type="text" class="form-control" id="url" name="url"
							placeholder="Website Title" value="<?php echo set_value('url');?>">
					</div>
				</div>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Description</label>
					<div class="col-lg-8">
					<span class="text text-danger">
						<?php echo form_error('description');?></span>
						<textarea name="description" id="description"
							class="form-control" rows="3"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Title</label>
					<div class="col-lg-8">
					<span class="text text-danger">
						<?php echo form_error('meta_title');?></span>
						<input type="text" class="form-control" id="meta_title"
							name="meta_title" >
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Keyword</label>
					<div class="col-lg-8">
					<span class="text text-danger">
						<?php echo form_error('meta_keyword');?></span>
						<textarea name="meta_keyword" id="meta_keyword"
							class="form-control" rows="3"></textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Description</label>
					<div class="col-lg-8">
					<span class="text text-danger">
						<?php echo form_error('meta_description');?></span>
						<textarea name="meta_description" id="meta_description"
							class="form-control" rows="3"></textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-8">
					<input type="submit" class="btn btn-info pull-right" name="add_category_submit" value="Add Category" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
</section>
<?php }?>
<?php 
if($mode=="EDIT"){
	?>

<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> CATEGORY MANAGEMENT (EDIT) <span class="pull-right"><a
				href="<?= base_url();?>secure/category_tree/management/show"
				type="button" class="btn btn-success btn-sm">Back to List</a> </span></header>
		<div class="panel-body">
			<form class="form-horizontal" role="form"
			name="add_category" method="post"
				action="<?= base_url();?>secure/category_tree/management/update">
				<?php
								$this->session->flashdata('message'); {
									$msg = $this->session->flashdata('message');
									echo '<font color="red">' . $msg . '</font>';
								}
								?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Title</label>
					<div class="col-lg-8">
						<input type="text" class="form-control" id="title" name="title" value="<?= $category['info']->name;?>"
							>
					</div>
				</div>

<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Url</label>
					<div class="col-lg-8">
						<input type="text" class="form-control" id="url" name="url" value="<?= $category['info']->url;?>"
							>
					</div>
				</div>
				
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Description</label>
					<div class="col-lg-8">

						<textarea class="form-control" name="description" id="description" rows="3">
						<?= $category['info']->description;?>
						</textarea>

					</div>
				</div>
				
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Title</label>
					<div class="col-lg-8">
						<input type="text" class="form-control" id="meta_title" name="meta_title"
							value="<?= $category['info']->meta_title;?>"
							>
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Keyword</label>
					<div class="col-lg-8">
						<textarea name="meta_keyword" id="meta_keyword" class="form-control" rows="3">
						<?= $category['info']->meta_keyword;?>
						</textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Description</label>
					<div class="col-lg-8">
						<textarea name="meta_description" id="meta_description" class="form-control" rows="3">
						<?= $category['info']->meta_description;?>
						</textarea>
					</div>
				</div>

				

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-8">
						<input type="hidden" name="id" value="<?= $id;?>">
					<input type="submit" class="btn btn-info pull-right" name="verify" value="Update" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"> 
					
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	<!-- page end-->
</section
			<?php }?>